//这个文件就是管理所有的接口的文件
import axios from './request'
// export const indexData=function(){
//     axios.get('/index/index')
// }
export const indexData = () => axios.get('/index/index')
//搜索页面数据 get的写法 （没带参数）
export const searchpopupData = () => axios.get('/search/index')
//请求搜索页的提示列表数据
// export const searchTipsData=(keyword)=>axios.get('/search/helper',{
//     params:{
//         keyword
//     }
// })
//请求搜索页的提示列表数据 优化写法
// export const searchTipsData = (obj) => axios.get('/search/helper', {
//     params: obj
// })
//get的写法 （带参数）
export const searchTipsData = (params) => axios.get('/search/helper', {params})
//post的写法 （带参赛)
// export const searchTipsData = (params) => axios.post('/search/helper', params)

//搜索确定的请求产品数据列表
export const searchListData = (params) => axios.get('/goods/list', {params})
//删除历史
export const clearHistory = () => axios.post('/search/clearhistory')
//登录接口（没有账号自动注册）
export const UserLogin = (params) => axios.post('/auth/loginByWeb', params)
//产品明细
export const proDetailData = (params) => axios.get('/goods/detail', {params})
//相关产品
export const proRelatedData = (params) => axios.get('/goods/related', {params})


//获取购物车产品数量
export const getGoodscount = () => axios.get('/cart/goodscount')
//加入购物车
export const addCart = (params) => axios.post('/cart/add', params)
//获取购物车数据 /cart/index
export const getGartData = () => axios.get('/cart/index')
// 点击切换商品选中状态（含全选）
export const changeGoodsChecked = (params) => axios.post('/cart/checked', params)

//商品步进器
export const goodsStepper = (params) => axios.post('/cart/update', params)
//删除商品 /cart/delete
export const Cartdel = (params) => axios.post('/cart/delete', params)

//专题页面
export const topicListData = (params) => axios.get('/topic/list', {params})
//分类
export const categoryData = (params) => axios.get('/catalog/index', {params})
//当前分类
export const currentCategoryDate = (params) => axios.get('/catalog/current', {params})

//分类数据获取
export const categoryDoods = (params) => axios.get('/goods/category', {params})
export const goodsList = (params) => axios.get('/goods/list', {params})


